<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/iconfont.css">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/swiper.min.css">
<link rel="stylesheet" href="css/styles.css">
<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
<script src="js/bootstrap.min.js" charset="UTF-8"></script>
<script src="js/swiper.min.js" charset="UTF-8"></script>
<script src="js/global.js" charset="UTF-8"></script>
<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
<title>U袋网</title>
<link rel="stylesheet" type="text/css"
	href="../admin/layui/css/layui.css" />
<script src="../admin/layui/layui.js" type="text/javascript"
	charset="utf-8"></script>
</head>
<body>
	<!-- 顶部tab -->
	<!-- 引入头部 -->
	<jsp:include page="header.jsp"></jsp:include>

	<div class="content inner">
		<section class="panel__div clearfix">
			<div class="filter-value">
				<div class="filter-title">用户评论反馈调查</div>
			</div>
			<form action="" class="issues-box form-horizontal layui-form" id="addForm">
				<p>尊敬的用户：</p>
				<p>您好！为了给您提供更好的服务，我们希望收集您使用U袋网的看法或建议，对您的配合和支持表示衷心感谢！</p>
				<div class="form-group">
					<div class="col-xs-12">
						<input type="text" style="margin-top: 35px" name="name" required
							lay-verify="required" placeholder="姓名/昵称" autocomplete="off"
							class="form-control">
					</div>
				</div>
				<div class="form-group">
					<div class="col-xs-12">
						<textarea name="content" rows="5" style="margin-top: 35px"
							required lay-verify="required" placeholder="请输入您的看法或建议"
							class="form-control"></textarea>
					</div>
				</div>

				<div class="form-group">
					<div class="col-xs-5">
						<button class="layui-btn" lay-submit lay-filter="addformDemo">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</section>
	</div>

	<!-- 右侧菜单 -->
	<!-- 引入右侧菜单 -->
	<jsp:include page="right-nav.jsp"></jsp:include>
	<!-- 底部信息 -->
	<!-- 引入脚部 -->
	<jsp:include page="footer.jsp"></jsp:include>


	<!-- 脚本开始 -->
	<script>
		layui.use([ 'table', 'form', 'layer', 'upload' ], function() {
			var table = layui.table;
			var form = layui.form;
			var layer = layui.layer;
			var upload = layui.upload;
			var $ = layui.$;

			//添加表单的单击事件
			$("#addBtn").click(function() {
				layer.open({
					type : 1,
					content : $('#addForm'),
					area : [ '800px', '600px' ]
				//这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
				});
			});

			//监听提交--添加
			form.on('submit(addformDemo)', function(data) {
				//layer.msg(JSON.stringify(data.field));
				//向服务端发送请求
				$.post("insertEvaluation", data.field, function(res) {
					if (res.code == "0") {
						layer.msg("成功", {
							time : 2000
						//成功提示弹出时间
						}, function() {
							layer.closeAll();//关闭所有的弹窗
							table.reload('idTest', {})//表格重载
						});
					} else if (res.code == 1) {
						layer.msg("添加失败，已经有该类型啦！", {
							time : 2000
						}, function() {
							layer.closeAll();//关闭所有窗口
						})
					}
				}, "json");
				return false;
			});//监听提交----添加 结束
		});
	</script>
	<!-- 脚本结束end -->

</body>
</html>